//
//  UIView+Angle.m
//  YLLottery
//
//  Created by apple on 2017/10/23.
//  Copyright © 2017年 Apple. All rights reserved.
//

#import "UIView+Angle.h"

@implementation UIView (Angle)
///设置View的圆角
- (void)strokeViewWithCornerRadius:(CGFloat)cornerRadius
{
    CAShapeLayer *maskLayer = [CAShapeLayer layer];
    UIBezierPath *bezierPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height) cornerRadius:cornerRadius *0.5];
    maskLayer.frame = CGRectMake(0, 0, cornerRadius, cornerRadius);
    maskLayer.fillColor = [UIColor blueColor].CGColor;
    maskLayer.strokeColor = [UIColor blueColor].CGColor;
    maskLayer.path = bezierPath.CGPath;
    [self.layer insertSublayer:maskLayer atIndex:0];
}
@end
